package com.swxy.club.enums;

import lombok.Getter;

@Getter
public enum ClubMemberRole {
    PRESIDENT("ROLE_PRESIDENT", "社长"),
    VICE_PRESIDENT("ROLE_VICE_PRESIDENT", "副社长"),
    MEMBER("ROLE_MEMBER", "普通成员");

    private final String code;
    private final String description;

    ClubMemberRole(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public static boolean isValid(String roleCode) {
        for (ClubMemberRole role : values()) {
            if (role.getCode().equals(roleCode)) {
                return true;
            }
        }
        return false;
    }
}